package com.itheima.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.BusinessService;
import com.itheima.health.utils.resources.MessageConstant;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class BusinessController {

    @Reference
    private BusinessService businessService;

    @GetMapping("business/findTableData")
    public Result findTableData(){
        try{
            Map map=businessService.findTableData();
            return new Result(true,MessageConstant.QUERY_TABLEDATA_SUCCESS,map);
        }catch (Exception e){
            return new Result(false,MessageConstant.QUERY_TABLEDATA_FAIL);
        }
    }
}
